//***************************************************************************
//*
//*	File:			DialogFilters.h
//*	Description:	Filters dialog
//*
//***************************************************************************
//*
//*	Note:			This source code is provided "as is" meaning that you may 
//*					use it at your own risk. 
//*					You are free to use it in any way you like.
//*
//***************************************************************************
//*
//*	History:		
//*
//*	-------------------------------------------------------------------------
//*	2003/07/27	|	Initial release									|	rk
//*	-------------------------------------------------------------------------
//*
//***************************************************************************

//
//-------------------------------------------------------------- PREPROCESSOR 
//

#ifndef			__DIALOGFILTERS_H_INCLUDED
#define			__DIALOGFILTERS_H_INCLUDED

#if				_MSC_VER > 1000
#pragma once
#ifdef			__SWITCH_SHOW_HEADER
#pragma message ("-- DialogFilters.h\n")
#endif
#ifdef			__SWITCH_SHOW_HEADER_TREE
#pragma message ("-- "__FILE__"\n")
#endif
#endif 

//
//-------------------------------------------------------------- DEPENDENCIES
//

#include		"DialogSmartReplace.h"

//
//--------------------------------------------------------- CLASS DECLARATION
//

//***************************************************************************
//**	@DOC		CLASS CDialogFilters
//***************************************************************************
//*		@CLASS		Dialog for managing filters
//**	@BASE		Dialog
//***************************************************************************
class CDialogFilters : public CDialog
{
	typedef CDialogSmartReplace::CFolder		CFolder			;
	typedef CDialogSmartReplace::CFileMask		CFileMask		;
	typedef CDialogSmartReplace::CFolderArray	CFolderArray	; 
	typedef CDialogSmartReplace::CFileMaskArray	CFileMaskArray	; 

	//																											
	//-----------------------------------------------------------------------									
	//***************************     ATTRIBS     ***************************									
	//-----------------------------------------------------------------------									
	//																											
private:																					// @ACCESS	Private Attributes	
	//{{AFX_DATA(CDialogFilters)															
	enum { IDD = IDD_FILTERS };																
	CListCtrl		m_ctrlListFolders	;														
	CListCtrl		m_ctrlListFileMasks	;														
	//}}AFX_DATA																			
	CFolderArray	m_arrFolders		;						
	CFileMaskArray	m_arrFileMasks		;						

	//																								
	//-----------------------------------------------------------------------						
	//***************************     GET/SET     ***************************						
	//-----------------------------------------------------------------------						
	//																								
public:																						// @ACCESS	Public Get/Set Methods
			void	GetFolders		(		CFolderArray&	a_arrFolders	)	const	;	// @CMEMBER	Returns the displayed folders
			void	GetFileMasks	(		CFileMaskArray&	a_arrFileMasks	)	const	;	// @CMEMBER	Returns the displayed file maks
									
			void	SetFolders		( const CFolderArray&	a_arrFolders	)			;	// @CMEMBER	Sets the folders	to display
			void	SetFileMasks	( const CFileMaskArray&	a_arrFileMasks	)			;	// @CMEMBER	Sets the file masks to display
																										
	//																													
	//-----------------------------------------------------------------------											
	//***************************     HELPERS     ***************************											
	//-----------------------------------------------------------------------											
	//																													
protected:																					// @ACCESS	Protected Helper Methods
			BOOL	GetFolder		(		int				a_iIndex
									,		CFolder&		a_Folder		)	const	;	// @CMEMBER	Determines the folder at the specified index
			BOOL	GetFileMask		(		int				a_iIndex
									,		CFileMask&		a_FileMask		)	const	;	// @CMEMBER	Determines the file mask at the specified index
			int		InsertFolder	(		int				a_iIndex
									, const	CFolder&		a_Folder		)			;	// @CMEMBER	Inserts the specified folder at the specified index
			int		InsertFileMask	(		int				a_iIndex
									, const	CFileMask&		a_FileMask		)			;	// @CMEMBER	Inserts the specified file mask at the specified index

			void	ImportFilters	( const	CString&		a_strFile		)			;	// @CMEMBER	Import filters from the specified file
			void	ExportFilters	( const	CString&		a_strFile		)			;	// @CMEMBER	Export filters to	the specified file

			void	UpdateControls	( void )											;	// @CMEMBER	Updates the controls
			void	UpdateMembers	( void )											;	// @CMEMBER	Updates the members

	//																						
	//-----------------------------------------------------------------------				
	//**************************     VIRTUALS     ***************************				
	//-----------------------------------------------------------------------				
	//																						
	//{{AFX_VIRTUAL(CDialogFilters)															
protected:																					// @ACCESS	Protected Overridables
	virtual void	DoDataExchange			( CDataExchange* pDX );							// @CMEMBER	DDX/DDV Support
	//}}AFX_VIRTUAL																			
																							
	//																							
	//-----------------------------------------------------------------------					
	//**************************     MESSAGES     ***************************				
	//-----------------------------------------------------------------------					
	//																							
protected:																					// @ACCESS	Protected Message Handlers
	//{{AFX_MSG(CDialogFilters)
	virtual BOOL OnInitDialog				();
	virtual void OnOK						();
	virtual void OnCancel					();
	afx_msg void OnExport					();
	afx_msg void OnImport					();
	afx_msg void OnRemoveFolder				();
	afx_msg void OnRemoveFile				();
	afx_msg void OnAddFolder				();
	afx_msg void OnAddFile					();
	afx_msg void OnItemActivateListFolders	( NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemActivateListFiles	( NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnEndLabelEditListFolders	( NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnEndLabelEditListFiles	( NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	//																						
	//-----------------------------------------------------------------------				
	//***********************     CON/DESTRUCTION     ***********************				
	//-----------------------------------------------------------------------				
	//																						
public:																						// @ACCESS	Public Con-/Destruction Methods	
	CDialogFilters(CWnd* pParent = NULL);   
};

//{{AFX_INSERT_LOCATION}}

#endif // __DIALOGFILTERS_H_INCLUDED
